package com.galaxis.wms.security.ext

import com.galaxis.wms.security.utils.SecurityContextExtUtils
import com.galaxis.wms.security.utils.UserInfoConvertUtils
import com.yvan.core.Conv
import com.yvan.security.model.UserInfo

class UserInfoExtension {
    /**
     * 获取 login_id
     */
    static Long getLoginId(UserInfo self) {
        return SecurityContextExtUtils.getLoginId()
    }

    /**
     * 获取 UserCode
     */
    static String getUserCode(UserInfo self) {
        return Conv.asString(self.getExt().get(UserInfoConvertUtils.USER_CODE), null)
    }
}
